package com.sujeet.euler;

public class prob1 {

	public static void main(String[] args) {
		int sum = 0;
		for (int i = 3; i < 1000; i = i + 3) {
			if (i % 5 != 0) {
				System.out.println(i);
				sum = sum + i;
			}
		}
		System.out.println("break");

		for (int i = 5; i < 1000; i = i + 5) {
			if (i % 3 != 0) {
				System.out.println(i);
				sum = sum + i;
			}
		}
		System.out.println("break");
		for (int i = 15; i < 1000; i = i + 15) {
			System.out.println(i);
			sum = sum + i;
		}
		
		System.out.println(sum);

		int nsum = 0;
		for (int i = 1; i<1000; i++) {
			if ((i % 5 == 0) || (i % 3 == 0)) {
				nsum = nsum + i;
			}
		}
		
		System.out.println(nsum);
	}

}
